#include <iostream>
using namespace std;

void swap(int &x,int &y)
{
    int tmp;
    tmp=x;
    x=y;
    y=tmp;
}
int main()
{
    int a,b;
    cin>>a>>b;
    cout<<"before: a = "<<a<<"   b = "<<b<<endl;
    swap(a,b);
    cout<<"after:  a = "<<a<<"   b = "<<b<<endl;
    return 0;
}

/*运行并思考：

如果第4行代码void swap(int &x,int &y)
替换成
void swap(int x,int y)

程序能运行么？运行结果？原因？
*/